layui.define(['form', 'table'], function(exports) {
    var $ = layui.$, table = layui.table, form = layui.form;

    form.on('submit(LAY-config-submit)', function (data) {
        var field = data.field;
        layer.confirm('确定要保存吗？', function (index) {
            $.ajax({
                type: "post",
                url: layui.setter.webRoot + "/cdb/device/cost/save.do",
                data: field,
                dataType: "json",
                success: function (res) {
                    if (res.code == 200) {
                        layer.msg('保存成功', {icon: 1});
                    } else {
                        layer.msg(res.msg, {icon: 2});
                    }
                }
            });
        });
    });

    exports('cdb_cost_index', {})
})